Moved all functions to .cpp file.