completely rewritten structure