implemented the basic functions (not tested yet)