first implementation to collect the data in sqlite