Changed loop over 2D-List to while, so elements can be deleted