updated based on eran's comments
last bit of tweaks