improved loop

everything now runs on a single hard timer rather than several soft
count timers.