adjustments to bostocks code for assignment 3