Add tie method and tests.

Must refactor this later (to improve performance)