Added instantiate function