removing unwanted _'s and including a test for duplicate name