added diagonal solution