Improved code

Made code easier to read & added more comments