sorting: javascript partly