complete testing logic