Adding loading program

and calculation improvements