Added ported code from Adventures of Rhongomiant