Refactoring and renaming variable for readability.
First attempt to fix knot and link color scheme.

Works beside when k Tangle has an unexpected parity of infinity.