sanity func