more elegant iteration over array indices
GUI improvements