[code modified] assign public to functions