fixed/optimized load function

Signed-off-by: William Rockwood <wrockwood@tadl.org>