updated script - work in  progress