Implementation of init.