Edited the template that was provided and
changed it to use a matrix instead of a vector
and to use the solve function instead of mean.