Moved the abundance calculations to its own function instead of main, fixed calulations of mass fractions