converted to tick function