making code more consistent, adding documentation