Merged all code into one file