added some comments, removed commented code