Composition of binary quadratic forms