brought in jmandel code.