I could not get addition to work correctly so I slightly modified the arithmetic to compensate. This is an issue I need to figure out later as it consumed most of my day.