script to construct dataset