Added constraints and made DLS more stable