Refactored code into multiple files, changed implementation of the gamma function to something more efficient