Cleaned up most of the code including more descriptions plus changed the way
parameters are read in from file.