correctly replaces sections, tested and documented