Improvements to variable naming, changed to tall format, simplifications to code