getindex and getdata functions added