test rewritten + diagonal detection WIP