reprogrammed rendering. added support for basic grid layout