first version of the script to separe data