added factorial to prep