New model pull request for code review

Usually using one letter variable names aren't best practice. I know the result math related code below is shorter, but can be confusing for someone else to read and debug.