naive implementation of mmsb
need to validate & optimize the current code