basic paint function done