code tweaks and docs