Took out debug codes, added duplicate replacment