updated pta

enhanced link functionality to remove existing links and auto increment
link keys