first version of sync script