Added comments and refactored code for better readability

Added some comments which proved helpful for me in understanding the code of toy graph creation