Refactoring and cleaning up build process
working factorial function!