Added scala encoding