adding itay's implementation