changing code to use new DAO class