Code to solve any equation of the form Ax=b