check in Dan's code (Jun 22, 2013 update)