Script is now functional