add functions for detecting violations