modified MGHole + minor tweaks