add functional scala