Functional parser. Need cleaning up.