added comments, refined what has to be done