Writing Sort to learn Pointers in C