cleaned up, more docs, added example code