fix a bug in util.h and to finish modal basis solver