added better testing functionality