Made a delegate class and initialize function