added import from file and changed arraysize and converted for loops to match them