a first semi working version