Added custom implementation of Pair class