Check for errors in pairing
Document and clean up code in some places, muss it up in others