scala homework #3