Implemented check for triangle