added test case with unreachable code
now handles unreachable code