Local variables introduced, minor changes