triangle square method improved