faster binary function