added button to toggle time lapse
cleaned up code
merged code