NAWQAAN-207

With NAWQAAN-234 bonus
Could we make these nested and chained function calls clearer? You might try assigning some of the inner calculations to descriptive variables and then performing the outer calculations on the variables post-assignment.