partially implemented one of the last bigger funcs