first working draft of DAL code