New changes. Most parts of the code now work