convert to scala