made window edge detection work