Improved modal logic, now cleaner and works better