creating hpp file and attempting the code for function in cpp