basic database; fixed CSA indexing bug