Updated dept loading algo