added simple solution for factorial