Ported for Memorycoin