heavily modified admintools.pl