solving equations 3 variables