old code (probably broken, certinly ugly).
old python scripts; need to be debugged and cleaned up