code Mk2

Moved declaration of variables to within correct function,
changed function declarations for time parameters, moved if/else
statements to save power when gps doesn't have a fix