moved init fucntion