added docs
updated comments