Adjacent patch creation

With some larger portion of the code reworked, the adjacent patch
creation now works and provides the basis for actual content generation.