db stuff unfinished