functionality implemented (not tested)