some modifications of Match.java