added advanced output and filelogging