Fix david's sloppy code