converted timer from timer: to erlang: