added function to get lement of an array