changed to scala