small change to is in triangle function