Moved many of the things to Scala
-Hopefully won't break things