updated constraint handling + corresponding tests