removed some unused variables, added some docstring info