Better testing function