Replaced previous parsing code with something that works the same