Added extract digit code