At last a working version