Some generic python math scripts