Added required functionality for project 2