worked more on DB representation
finished up DB code