I haven't touched Arduino since returning to work, and am a bit rusty and no not too hot on coding.
However, you might want to look into "XOD" as this really simplifies programming with drag and drop boxes - especially with logic sequences.
Sorry I can't be of any more help.