global i instead of local i go figure