Adding code clarifiction and minor edits