finished the load function