add Renato's constraints, fix priority bug