added sql schema and more updates to data handling