got factorial working