A little cleanup after last commit; still needs testing and reasonable values for user inputs.