Added naive sorting