moved inner class definition to the bottom for claritiy
operating on AIDs; added exceptions
added behaviours to respond to registration, deregistration and matchmaking requests
setting registration behaviour to done after it has finished