triangle drawing code