whiles not working in decode