updated broken code