refactored , added feedback if nothing/duplicate value is entered