some tweaking of sorting mechanisms