rewriting with code from old