Added comments in file to explain code.