working parser code