make types work in both loops