fixed a ton of import errors and added memory mode to the lantern