accounted for impossible triangles in js and updated the html formatting