Reads input into array