Moved all code to prog2.cpp, added code to print running time