finished re implementation of dao