rewrote mega, for patch savings