Added iterator scheme to save memory