structure rewrite. basic functioning