refactor method to return the factorial of a number instead of the factorial sequence; rename method 'factorial'