Changed for loop to foreach

Displaying salaries in three columns