As I run the program the output array generally seems partially sorted while the generated array isn't.