read instructions and generate arrays