finished triangle exercise and iteration