mid exercise
fix db issues and naming