As others have noted, what you have is illegal under modern code. The problem you are facing is how to make it legal under today's code, and that is where the can of worms lies. There are many pitfalls that a novice will encounter in plumbing. Some large, some not-so large, but any of them can be done wrong and cause you to fail inspection which results in having to tear out work and redo it. DIY is fine, but we all reach points that are beyond our experience. Books are fine, but ask any pro if everything he knows came out of a book. He learned on the job with a journeyman overseeing his work and chewing is tail when he didn't do something perfectly. I would urge you to hire a professional. Perhaps you can do some of the "grunt" work and save a dollar to two, but you will be time and money ahead having it done right the first time.