a few changes by Ran