implementing the basic functions