fixing solution
more test cases to isolate issues