Finalized db structure and added mixing code