Function 2 to start Beta functions: Functions taken from https://github.com/OnofriAndreaPG/aomisc
Useful links