Put in pseudo code and comments

Copied info from examples as a starter. Need to modify so that it
manipulates matrix and does the inversion rather than calculating the
mean of an array (as per the original example).