Fix function initialization

Fixed how the functions were created.