Assignment 1 Part 3 (though evidently slightly buggy?)