some more work
quite working version