Loading the function and CodeBook