Formatted and added few code snippets.