Homework 5 for Computational Physics course