first partial working version