rewrote first part of opt and gen chapter