This seems odd.  Why would this code be using ticks at all in its computation?