Pulled out variables, added libraries to compile line