Including Dave's improvments