fixing lookup version code according to new specs
updating code according to DAO changes. no working tests yet.