begin init function