Removed unnecessary comment;concised paint logic