now parses input in a somewhat reasonable way.