First fully working version