now handles binary case