solve by substitution