flesh out and add testing to parser, minor formatting changes