Made things happen more automatically, in a slightly hacky way.