initial calculation complete

no capital gains yet
not tested either