Create function to return instance of an object