Modified to complete assignment 42