end of writing code for da (not tested at all)