Added a basic tag system and fixed bugs