made tolerance dependent on estimated minimum potential energy, added design document