- cleaned up code
- updated doc.