fixed factorial to now be correct