Added some much needed comments and explenations.