Added factorial method