Changes to calcdistances to weed out all cofactors plus print debugging files
Pulled mark_cofactors out as a separate subroutine and removed some debugging code