Added SKIP_SPACES macro to avoid rewriting a loop