Implemented message-driven interface.
Everything needs checking baaadly