problem with solving a system of equations