More functionality for assignment 2