fixed error and added some more explanations