Added matchEnd flag to process, and simplified outputs