use std::sort, that improves dramatically the performance

previous sorting algo was in O(n^2)