crazy ass nested forEach

please work please work please work