typo that fucked up calculations
added helper method
working on write