ENHANCED finding corner by reducing number of print statements