New version

Improved side repositioning algorithms