implement frame. todo copying logic.