My actual code. :)

Adding comments as well