madlib.cpp changes

getmadlib() function updated