Added some code to withdraw (not tested yet!!!).