First quasi working version