implement painting cells