new version of mialgo, add sufficient unittest