added some more free functions, cleaned up some things, updated example code.