bugfix, added sanity check to right triangles