Optimized cycle len computation

Did couple of changes:
- Removed memset as global variables is initialized to 0 in PC context
:-)
- Had a flag called 'reversed' to know when i & j were reversed. A check
was done for every print. Eliminated it
- Primarily reduced cycle length compute based on already computed cycle
len of intermediate numbers.