Completed assignment 3a and 3b