implemented canvas rendering optimizations