added source tracking support (experimental - like all the rest of the code)