Modify code to work with new library