working version..(to my mind)