First version of Grounded

Implemented as described by the pseudocode.