Created paint function