document updates; function bug fixed