writte by scala