Added loadPatch function