Lots of edits and additional calculations.