makeCycle done and worked on adding test cases
fixed seg fault