First working version, very basic but working