Fixed issue with not correctly grabbing input values
Better function for checking if a value is a duplicate
Removes code that is now redundant