bug fixes

all but sort_insertion work