Updated test case, removed unnecessary branching in code