paint() function save