not tested yet. functions are written