Code for first "SA" program.