now using init funtion to load global vars