added new lib + new functionality to optimization