Possibly a fix to a possible casting bug?
Added a pair class