Removed debug printout and unreachable code