Modified program to take in parameters.