Fixed the bugs, now the code updates the tign