mostly fixed database, repository issues
added db generation script