update code and docs