Added unit test, refactored code, and improved implementation