implemented index of object for array