Added Triangle and modified conditions