Updated initialize function