added documentation of parameters, fixed drunken mistake in passing parameters