Refactoring. Added Trinagle method.