Tweaks_to_Jeffs code