brought forward the deamortized version from the overmars branch as a module