init implementation

has bugs