Initial work defining functions and commenting.
It works when being passed a matrix
Added comments