merge yoni's code