Code to add Links Integrated, Algorithm now uses dictionary instead of 2D array