simple painting function