corrected data storage in array