wrote some cleaner code and fixed exclude tag feature