reworked test routine