homework 03, making code a bit more comprehensible