CS 221: Completed assignment 5 #1b