Removed pesky Java code and replaced with some purty Scala