fixing logic and making unit test pass