realizing of painting algorithms