changed to using apache's Pair class