very unfinished implementation for reading db