fixed sort, added bugs first feature