Potentially complete patch implementation.
- Really hacky/ugly/untested implementation so far,
  but I'll work on it.