Implemented the check if triangle method!