doc diagonal method