updated raw loading function