init funtioning