Added more verbose comments to make code much more understandable.