another rewrite