Added logic and unit tests for deposit, withdraw and transfer functions