New mostly working version!