make the tick function pure