oups, reinserted some useful code