use the project() method to improve constraint following algorithm