refactored diagonal checks