Added an initialization function for layers