Worked with collatz problem