Added main funcionality for credit and debit model