Using pointers instead of indices