Trying to fix read pair func