cleaned up code that creates arrays from csv