Grid mode implemented. Fixes #9.