added diagonal tunnel function