Adds a sanity_check.

This is mostly for documentation purposes.
ROTS by @mlucy