Added function to remove dead code.