moved all function declerations to top of .cpp file