Adding several new features to the script