Fixing up the function to find the minimal cross entropy