Added tests and pair conversion