implementing some basic functions