Added unit tests and function skeleton