allowed input to be the integer 1 in def factor()