update example, code cleaning