Using integer class instead of ranges and special case for factorial of 0 added