with comments from Istvan.  Need to be moved into dev file.