main data structure - simple implementation in java