created function tick(). Damn. What I wrote for tick is so stupidly simple...I'm almost afraid it's incorrect. But it appears to be working. Further testing required.