Update problem 2 to match current scala syntax