Fixed a few bugs and added some clarity