pre-test and main part working