combined a couple of functions