Rewrote timerstub in raw javascript