read triangle from text file
seperate into common function