added two examples and code beautification