added NMMSO algorith, and fixed bug in hive subroutine