Solution for problem 34. Fix factorial and move to utils directory.