implementing a couple of functions