runtests function taken out of mail