last loop not needed