Finished off another project euler exercise