rewriting parser to use attoparsec