improved grid rendering