Changing out 'iter' for 'n' and fixing list_index()