changed backward substitution and added m_x to vertex for the solution