fixed multi-dimensional syntax error; added clearGrid