Sort implemented and proven