Adding unit testing code, cleaned up the grid a bit.