complete restructuring of timer
but timer is broken now
need to implement system-timer still