fixed a minor bug in grid creation, added grid drawing