Lots of cleaning up
Added example code