many updates to algorithms and datastructures. minimum cloning size now considered and parts can be merged