implemented cross entropy