deleted loop added clarifying comments