refactored code #65, implemented wallets #64