Switched to solve() rather than ginv()