Rearranged load script to use less memory