adding optional auto paint function