first code for paint - not tested