updated function.php for library