code for assigning constraints and related code added