increase performance by painting a row at a time