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