removed copy_out_data and merged it with basic example