some debugging for the load scripts and some sorting tweaks