Script to generate final dataset