added web mode and some other magic