Updating initialize method to make CPU do the same as GPU.