Completed the first part of assignment 2