Explained the functioning of script