Code commented and an example added