modified the projection method to support different constraints for each node.