Fixed a bug and changed some comments.