Paint function added