Adding library functions. First version.