Datastructures and helper classes for scala