Modified tick function.