added test cases to binary; reorganized binary functions