if we are going to write our own code for this, we should include unit tests.