added diagonal fxn