init part of the function