refactoring code

 Trying to make the intervalometer work