Modified "Structure.java" for Scala compatibility