Implemented the initialize method in the .cpp file