ntor prototype; needs refactoring and TESTING