Fixes problem in method checkIfTriangle