Updated the example, cleaned up some code.