near final version, minor issues