Added apllying and removing tags + small code fixes