credits now have sign - refactoring summations and settlement code.