CSPACE-5939: First fully-working version of script.