My own pixel-sort program in C++