realy working version for first example