Final working code (Before will shits with it)