Cleanups for Copy()

Docs and slight code formatting issues.
Rename dupIP to copyIP

Also make the function shorter.
Formatting and reshuffle some code