working on the array code