Cleaned up some syntax. Fixed gender tagging for edge cases