working on re-organizing code so that it is easier to follow from the calculation standpoint (less efficient, but hopefully easier to follow!)