Added unit tests, still need to add a few more.