switching over to scala