Added TomDoc, refactored to remove magic number.