refine scripts; abandon sort part