refactor to allow user to enter name