Changed program to use an input