Fixed to use solve instead of mean