updated codes for parsing