Now uses an array of structs  instead of two separate arrays.