moved arrays out to separate files, moved logic into separate file