tag refactored and comments added