Add solution for factorial