Modified for hw3