Rewrite ending & beginning of cube