update
external sorting
c wrapper function