added initializeCallback() function and did some code modifications