updates docs
cleans up code