Added vestigial count for aborting adjacency checks
Made the count count
Moved those functions out of global scope