rearranging and cleaned up scripts and libs