Added user input for n