use arrays and only 1 put call, fix mismatched data types for indices.