Added unit tests and new features