wokring with 1d array