Updated docs and reordered calculation