First fully working version :D