started solving #42
added triangle methods