fixed bug in ticks computation