Modified initialize function