changed diagonal checker to programmatically check for diagonal instead of
manually checking edge cases.