partially done sort3, need to fix