made parser more readable and robust. removed warnings from other files.