renaming
essential indices
interfacing and swapping
some pointer arithmetic