added intermediate version of the script