added Triangle impl with tests