Code after resolving bugs and passing test case