Made more comments to explain whats happening and cleaned up