pls put the implementation into the .cpp file

Also, would you write a little unit test that ensures this function really does what it should? Always helpful