Code supporting examples in Math4Money blog