A naive patch theory implementation