working triangle test. slow.