New function to define n AE functions