cleaner mapping translation algorithm

Originally was intended for fixing issue #3, but no luck