Added coments, handled whitespace better