Updated to allow user to change parameters.