Implemented modes and flashing

Seems to be some delay in switching time setting