First working version

Fully working one