Advanced Java Assignment