Finally implemented the correct way to parse the data