First working version[updates comes later]