binary var implementation