improve canvas drawing