Construct a Turing Machine which tests if a given character string consists of an equal number of zeros and ones, regardless of their order.

Example of correct strings.
Initial condition
The character string is bounded by #-symbols on both sides. The read/write-head starts on left #-symbol.
Final condition
If the character string consists of an equal number of zeros and ones, the Turing Machine has to terminate in an empty world. If there are more zeros or more ones, it should replace the left #-symbol with a zero or a one, respectively, and terminate.