I really should read the documentation before copying sample code.