solve system of 4 equations