de-bugged code for test cases that failed