program to solve linear equation. works 90%