First working version with all the features