added diagonal checker, not debugged
merged