Dynamic Grid

Moved the creation of the template so that a grid can be dynamic