updated docs
updated docs, cleaned up code