adding endstates to the max margin constraints