solve implementation working for 3 unit tests