Few scala problems