added user input and cleaned up code also added print list method