scala only version :)

I relied heavily on eclipse 'paste as scala code' so I might have missed stuff here and there, but I tested the code and it looks like it's working.