sorted vectors algorithm version1 cleanup