finished working parser with bugs