removed some unnecessary variables; updated documentation