loop bug fixed. Parser improved