a few optimizations. added quick grid renderer for debugging.