initial script, and working like a charm