major changes to library functions