Update of code

Code still not perfect