fixed timing to use timer structs rather than one set of global variables