added triangle function
hopefully this doesnt break everything