Impolemented incremental mode, added sequential database query