re-added Brian's changes I think