This is the updated file with the two functions