improved program and now takes a single arguement for the input