Program not working as intended

Definitely not if the code is properly structured with no blocking delay()s, etc.