add code from http://www.stroustrup.com/Programming/