add scala dev code
better writer