Create Ties-Function.R