Refactoring

Edit function to loop through array and check for duplicates before
pushing to array on submit