switched to explicit parameters instead of comparator object
switched to explicit parameters instead of comparator object
added documentation for sorting functions