universalized biosort.cpp code slightly