Merge pull request #8 from dejay/master

Altered tie mechanism to use a double-nested for loop