did review of some stuff
do not review Test-Class
factor out the triangle number generator