added a few of the functions that Yacheng used in modvsobs