A minimal implementation of Morgan's algorithm