finished tony's exercises on intermediate scala