simplistic triangle implementation (UNTESTED)