handling empty bins for entropy correctly