Implemented the withdraw method and its tests.