changed if to when

ended up with a underdetermined system