partial rework followint Eyal's notes - WIP