Improved message delivery algorithm