having this perfect knowledge , the inventor realized he needed to quickly invent an 'imperfect restoration ' machine to restore all those who had passed through the perfect portal to their prior selves .