made all variables local