Converting to scala