Minor corrections as per code review; ordered array, !foreach, variable names