CDB-2834 Added fully working version of the script to the repo