Added traversal checking code

fixes #11