Code cleanup

Code cleanup to remove lots of variable name changes, cleaned some
expressions to calculate inline as opposed to creating additional
variables.  Did not yet update heatmap to latest version.