added edge detection
extracted out Cellmatrix reference in AI and added LineyEntity