updated/refactored timer.h