small amount of code I wrote for Yannis's Law checking