Added the badge function