Checking till it contains a cycle or not -- Long way to go