beginnings of load function