draft code for work with COIN