Well, this
issue is elementary (not so hard to do in the practice as it sounds like, or as some other issues theoretically could be), but it is definitely not conveniently.
I could give you a nice introduction on this issues without any problems, but I don't have every minute free time, so I recommend that all people that are interested in this issue try to search for it in a digital search engine. I suggest that you use appropriate parameters, so you will receive pure useful information.