Added Parser failure index. Removed duplicate code. Added end of input detection.