added a comments to make code more readable.