Simplify m(m^3-5m^2+7m)-m(m^2-1)