writing test triangle build function