indexselect working with memcpy