Modifications to enable use of Mega