completed basic functionallity of factorial project