Need to improve Triangle code. It works but takes forever.