Started implementing pairing functionality
Cleaned up code