code when learning scala