Adding code updates sent by Kevin Debeil