code structure
structure changes and java-class for testing