Patched a few bugs in the calculation
readd readme