Added many useful library functions.