Updated code to use new lib