Added solver and inverse code