Add painter sample algorithm