Added load function and tests