Updated to use SQlite. not a working copy. still debugging.