Fixed some things and the code is now commented