Copied code from example

Copied the code from the example and changed the names of functions and
also changed the mean function to a solve function.