completing the initial occurrence sort