Initial code based on ev3wallet