fix code style and updated examples based on review comments.