Simplest solution for the triangle exercise
Minor refactoring of the triangle exercise