Infinite patch depth working. Time to clean up.
Added cache patch method.