converting nlolib.py function library into library of classes