added constraints, constraint checking