added sanity checking
Sanity check is expensive