mishras original implementation of message.h