Added task_tick function