use first_tick and last_tick instead of ticks.first and ticks.last