try follow ANSI C style (do not declare vars in for-loops)