Removed copy() from state, and added file loging of matches.